import React, {
    useState
} from 'react';


function Child({
    title
}) {
    console.log('child');

    return ( 
        <h1> child is {
            title
        } </h1>
    )
}

function App() {
    console.log('App');
    const changeInfo = () =>{
       setTitle('react17.2');
       setSubTitle('reactHooks to so easy')
   }

    const [title, setTitle] = useState('react');
    const [subTitle, setSubTitle] = useState('reactHooks');
    return (
       <>
       <h1>first : { title }</h1>
       <h1>second : { subTitle }</h1>
       <Child title = { title} />
       <button onClick ={ changeInfo }>chang to</button>
       </> 
    )
}

export default App;